// 抽象图形类
abstract class Shape {
    public abstract void draw();
}

// 具体图形类 - 圆形
class Circle extends Shape {
    @Override
    public void draw() {
        System.out.println("绘制圆形");
    }
}

// 具体图形类 - 矩形
class Rectangle extends Shape {
    @Override
    public void draw() {
        System.out.println("绘制矩形");
    }
}

// 图形工厂类
class ShapeFactory {
    public static Shape createShape(String shapeType) {
        if ("圆形".equals(shapeType)) {
            return new Circle();
        } else if ("矩形".equals(shapeType)) {
            return new Rectangle();
        }
        throw new IllegalArgumentException("不支持的图形类型");
    }
}

// 测试工厂模式
public class FactoryTest {
    public static void main(String[] args) {
        Shape circle = ShapeFactory.createShape("圆形");
        circle.draw();

        Shape rectangle = ShapeFactory.createShape("矩形");
        rectangle.draw();
    }
}